import request from '@/utils/request'
// 先用全路径
export function fetchList() {
  return request({
    url: 'http://checking.fothing.com/api/oss/region/level',
    method: 'get'
  })
}

export function fetchChildList(regionId) {
  return request({
    url: `http://checking.fothing.com/api/oss/region/${regionId}/children`,
    method: 'get'
  })
}

export function del(id) {
  return request({
    url: `http://checking.fothing.com/api/oss/region/${id}`,
    method: 'delete'
  })
}

export function create(data) {
  return request({
    url: 'http://checking.fothing.com/api/oss/region',
    method: 'post',
    data
  })
}

export function update(data) {
  return request({
    url: 'http://checking.fothing.com/api/oss/region',
    method: 'put',
    data
  })
}
